home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / shapeshifter / hardfile / utility.ss / MacZip 1.01 final.sit / MacZip 1.01 final / docs / zip.doc < prev    next >
Text File  |  1998-10-27  |  40KB  |  1,057 lines

  1.  
  2.  
  3.  
  4. ZIP(1L)                                                   ZIP(1L)
  5.  
  6.  
  7. NAME
  8.        zip,  zipcloak,  zipnote,  zipsplit - package and compress
  9.        (archive) files
  10.  
  11. SYNOPSIS
  12.        zip [-AcdDeEfFghjklLmoqrRSTuvVwXyz@$]  [-b path]  [-n suf-
  13.        fixes]  [-t mmddyyyy]  [-tt mmddyyyy]  [  zipfile  [ file1
  14.        file2 ...]] [-xi list]
  15.  
  16.        zipcloak [-dhL] [-b path] zipfile
  17.  
  18.        zipnote [-hwL] [-b path] zipfile
  19.  
  20.        zipsplit [-hiLpst] [-n size] [-b path] zipfile
  21.  
  22. DESCRIPTION
  23.        zip is a compression and file packaging utility for  Unix,
  24.        VMS,  MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh,
  25.        Amiga and Acorn RISC OS.
  26.  
  27.        It is analogous to a  combination  of  the  UNIX  commands
  28.        tar(1)  and compress(1) and is compatible with PKZIP (Phil
  29.        Katz's ZIP for MSDOS systems).
  30.  
  31.        A companion program  (unzip(1L)),  unpacks  zip  archives.
  32.        The zip and unzip(1L) programs can work with archives pro-
  33.        duced by PKZIP,  and  PKZIP  and  PKUNZIP  can  work  with
  34.        archives  produced  by zip.  zip version 2.2 is compatible
  35.        with PKZIP 2.04.  Note that PKUNZIP  1.10  cannot  extract
  36.        files  produced  by  PKZIP  2.04  or zip 2.2. You must use
  37.        PKUNZIP 2.04g  or  unzip  5.0p1  (or  later  versions)  to
  38.        extract them.
  39.  
  40.        For a brief help on zip and unzip, run each without speci-
  41.        fying any parameters on the command line.
  42.  
  43.        The program is useful for packaging a  set  of  files  for
  44.        distribution;  for  archiving  files;  and for saving disk
  45.        space by temporarily compressing unused files or  directo-
  46.        ries.
  47.  
  48.        The  zip  program puts one or more compressed files into a
  49.        single zip archive, along with information about the files
  50.        (name,  path, date, time of last modification, protection,
  51.        and check  information  to  verify  file  integrity).   An
  52.        entire  directory  structure  can  be  packed  into  a zip
  53.        archive with a single command.  Compression ratios of  2:1
  54.        to 3:1 are common for text files.  zip has one compression
  55.        method (deflation) and can also store files  without  com-
  56.        pression.  zip automatically chooses the better of the two
  57.        for each file to be compressed.
  58.  
  59.        When given the name of an existing zip archive,  zip  will
  60.        replace  identically  named  entries in the zip archive or
  61.  
  62.  
  63.  
  64. Info-ZIP              27 October 1998 (v2.3)                    1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ZIP(1L)                                                   ZIP(1L)
  71.  
  72.  
  73.        add entries for new names.  For example, if foo.zip exists
  74.        and  contains  foo/file1  and foo/file2, and the directory
  75.        foo contains the files foo/file1 and foo/file3, then:
  76.  
  77.               zip -r foo foo
  78.  
  79.        will replace foo/file1 in foo.zip  and  add  foo/file3  to
  80.        foo.zip.    After   this,   foo.zip   contains  foo/file1,
  81.        foo/file2, and foo/file3, with  foo/file2  unchanged  from
  82.        before.
  83.  
  84.        If the file list is specified as -@, zip takes the list of
  85.        input files from standard input.  Under UNIX, this  option
  86.        can  be  used  to  powerful effect in conjunction with the
  87.        find(1) command.  For example, to archive all the C source
  88.        files in the current directory and its subdirectories:
  89.  
  90.               find . -name "*.[ch]" -print | zip source -@
  91.  
  92.        (note  that  the  pattern must be quoted to keep the shell
  93.        from expanding it).  zip will also accept  a  single  dash
  94.        ("-")  as  the  zip file name, in which case it will write
  95.        the zip file to standard output, allowing the output to be
  96.        piped to another program. For example:
  97.  
  98.               zip -r - . | dd of=/dev/nrst0 obs=16k
  99.  
  100.        would  write  the  zip  output directly to a tape with the
  101.        specified block size for the purpose  of  backing  up  the
  102.        current directory.
  103.  
  104.        zip also accepts a single dash ("-") as the name of a file
  105.        to be compressed, in which case it will read the file from
  106.        standard  input,  allowing  zip to take input from another
  107.        program. For example:
  108.  
  109.               tar cf - . | zip backup -
  110.  
  111.        would compress the output of the tar command for the  pur-
  112.        pose  of  backing up the current directory. This generally
  113.        produces better  compression  than  the  previous  example
  114.        using  the  -r  option,  because zip can take advantage of
  115.        redundancy between files. The backup can be restored using
  116.        the command
  117.  
  118.               unzip -p backup | tar xf -
  119.  
  120.        When  no zip file name is given and stdout is not a termi-
  121.        nal, zip acts as a filter, compressing standard  input  to
  122.        standard output.  For example,
  123.  
  124.               tar cf - . | zip | dd of=/dev/nrst0 obs=16k
  125.  
  126.        is equivalent to
  127.  
  128.  
  129.  
  130. Info-ZIP              27 October 1998 (v2.3)                    2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ZIP(1L)                                                   ZIP(1L)
  137.  
  138.  
  139.               tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k
  140.  
  141.        zip  archives created in this manner can be extracted with
  142.        the program funzip which is provided in the unzip package,
  143.        or  by  gunzip  which is provided in the gzip package. For
  144.        example:
  145.  
  146.        dd if=/dev/nrst0  ibs=16k | funzip | tar xvf -
  147.  
  148.        When changing an existing zip archive, zip  will  write  a
  149.        temporary file with the new contents, and only replace the
  150.        old one when the process of creating the new  version  has
  151.        been completed without error.
  152.  
  153.        If  the name of the zip archive does not contain an exten-
  154.        sion, the extension .zip is added.  If  the  name  already
  155.        contains  an extension other than .zip the existing exten-
  156.        sion is kept unchanged.
  157.  
  158. OPTIONS
  159.        -A     Adjust self-extracting executable archive.  A self-
  160.               extracting   executable   archive   is  created  by
  161.               prepending the SFX stub to an existing archive. The
  162.               -A  option  tells  zip  to adjust the entry offsets
  163.               stored in the archive to  take  into  account  this
  164.               "preamble" data.
  165.  
  166.        Note: self-extracting archives for the Amiga are a special
  167.        case.  At present, only the Amiga port of Zip  is  capable
  168.        of adjusting or updating these without corrupting them. -J
  169.        can be used to remove the SFX stub if other  updates  need
  170.        to be made.
  171.  
  172.        -b path
  173.               Use  the  specified  path  for  the  temporary  zip
  174.               archive. For example:
  175.  
  176.                      zip -b /tmp stuff *
  177.  
  178.               will put the temporary zip archive in the directory
  179.               /tmp,  copying over stuff.zip to the current direc-
  180.               tory when done. This option  is  only  useful  when
  181.               updating  an  existing archive, and the file system
  182.               containing this old archive does  not  have  enough
  183.               space to hold both old and new archives at the same
  184.               time.
  185.  
  186.        -c     Add one-line comments for each file.   File  opera-
  187.               tions  (adding,  updating)  are done first, and the
  188.               user is then prompted for a  one-line  comment  for
  189.               each  file.   Enter the comment followed by return,
  190.               or just return for no comment.
  191.  
  192.        -d     Remove (delete) entries from a  zip  archive.   For
  193.  
  194.  
  195.  
  196. Info-ZIP              27 October 1998 (v2.3)                    3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ZIP(1L)                                                   ZIP(1L)
  203.  
  204.  
  205.               example:
  206.  
  207.                      zip -d foo foo/tom/junk foo/harry/\* \*.o
  208.  
  209.               will  remove  the  entry  foo/tom/junk,  all of the
  210.               files that start with foo/harry/, and  all  of  the
  211.               files  that  end  with .o (in any path).  Note that
  212.               shell pathname expansion has  been  inhibited  with
  213.               backslashes,  so  that  zip  can see the asterisks,
  214.               enabling zip to match on the contents  of  the  zip
  215.               archive  instead  of  the  contents  of the current
  216.               directory.
  217.  
  218.               Under MSDOS, -d is case sensitive when  it  matches
  219.               names  in the zip archive.  This requires that file
  220.               names be entered in upper case if they were  zipped
  221.               by PKZIP on an MSDOS system.
  222.  
  223.        -df    [MacOS   only]  Include  only  data-fork  of  files
  224.               zipped into the archive.  Good for exporting  files
  225.               to  foreign operating-systems.  Resource-forks will
  226.               be ignored at all.
  227.  
  228.        -D     Do not create entries in the zip archive for direc-
  229.               tories.   Directory  entries are created by default
  230.               so that their attributes can be saved  in  the  zip
  231.               archive.   The  environment  variable ZIPOPT can be
  232.               used to change the  default  options.  For  example
  233.               under Unix with sh:
  234.  
  235.                      ZIPOPT="-D"; export ZIPOPT
  236.  
  237.               (The  variable  ZIPOPT  can  be used for any option
  238.               except -i and -x and can include several  options.)
  239.               The  option  -D  is a shorthand for -x "*/" but the
  240.               latter cannot be set as default in the ZIPOPT envi-
  241.               ronment variable.
  242.  
  243.        -e     Encrypt  the  contents  of  the zip archive using a
  244.               password  which  is  entered  on  the  terminal  in
  245.               response  to  a prompt (this will not be echoed; if
  246.               standard error is not a tty, zip will exit with  an
  247.               error).   The  password  prompt is repeated to save
  248.               the user from typing errors.
  249.  
  250.        -f     Replace (freshen) an  existing  entry  in  the  zip
  251.               archive  only if it has been modified more recently
  252.               than the version already in the zip archive; unlike
  253.               the update option (-u) this will not add files that
  254.               are not already in the zip archive.  For example:
  255.  
  256.                      zip -f foo
  257.  
  258.               This command should be run from the same  directory
  259.  
  260.  
  261.  
  262. Info-ZIP              27 October 1998 (v2.3)                    4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ZIP(1L)                                                   ZIP(1L)
  269.  
  270.  
  271.               from  which the original zip command was run, since
  272.               paths stored in zip archives are always relative.
  273.  
  274.               Note that  the  timezone  environment  variable  TZ
  275.               should  be  set  according to the local timezone in
  276.               order for the -f , -u and -o options to  work  cor-
  277.               rectly.
  278.  
  279.               The  reasons  behind  this  are somewhat subtle but
  280.               have to do with the differences between  the  Unix-
  281.               format  file  times (always in GMT) and most of the
  282.               other operating systems (always local time) and the
  283.               necessity  to  compare the two.  A typical TZ value
  284.               is ``MET-1MEST'' (Middle European time  with  auto-
  285.               matic  adjustment  for  ``summertime''  or Daylight
  286.               Savings Time).
  287.  
  288.        -F     Fix the zip archive. This option  can  be  used  if
  289.               some portions of the archive are missing. It is not
  290.               guaranteed to work, so you MUST make  a  backup  of
  291.               the original archive first.
  292.  
  293.               When  doubled  as in -FF the compressed sizes given
  294.               inside the damaged archive are not trusted and  zip
  295.               scans for special signatures to identify the limits
  296.               between the archive members. The single -F is  more
  297.               reliable  if  the  archive is not too much damaged,
  298.               for example if it has only been truncated,  so  try
  299.               this option first.
  300.  
  301.               Neither option will recover archives that have been
  302.               incorrectly transferred in ascii  mode  instead  of
  303.               binary.  After  the  repair, the -t option of unzip
  304.               may show that some files have a bad CRC. Such files
  305.               cannot  be  recovered; you can remove them from the
  306.               archive using the -d option of zip.
  307.  
  308.        -g     Grow (append to) the specified zip archive, instead
  309.               of creating a new one. If this operation fails, zip
  310.               attempts to restore the  archive  to  its  original
  311.               state.  If the restoration fails, the archive might
  312.               become  corrupted.  This  option  is  ignored  when
  313.               there's  no  existing  archive or when at least one
  314.               archive member must be updated or deleted.
  315.  
  316.        -h     Display the zip help information (this also appears
  317.               if zip is run with no arguments).
  318.  
  319.        -i files
  320.               Include only the specified files, as in:
  321.  
  322.                      zip -r foo . -i \*.c
  323.  
  324.               which will include only the files that end in .c in
  325.  
  326.  
  327.  
  328. Info-ZIP              27 October 1998 (v2.3)                    5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ZIP(1L)                                                   ZIP(1L)
  335.  
  336.  
  337.               the current directory and its subdirectories. (Note
  338.               for PKZIP users: the equivalent command is
  339.  
  340.                      pkzip -rP foo *.c
  341.  
  342.               PKZIP does not allow recursion in directories other
  343.               than the current one.)  The  backslash  avoids  the
  344.               shell  filename  substitution,  so  that  the  name
  345.               matching is performed by zip at all directory  lev-
  346.               els.
  347.  
  348.               Also possible:
  349.  
  350.                      zip -r foo  . -i@include.lst
  351.  
  352.               which  will  only  include the files in the current
  353.               directory and its  subdirectories  that  match  the
  354.               patterns in the file include.lst.
  355.  
  356.        -I     Don't  scan  through  Image  files.  This option is
  357.               available on Acorn RISC OS  only;  when  used,  zip
  358.               will  not  consider Image files (eg. DOS partitions
  359.               or Spark archives when SparkFS is loaded) as direc-
  360.               tories but will store them as single files.
  361.  
  362.               For  example, if you have SparkFS loaded, zipping a
  363.               Spark archive will result in a zipfile containing a
  364.               directory  (and  its  content)  while using the 'I'
  365.               option will result in a zipfile containing a  Spark
  366.               archive.  Obviously  this  second case will also be
  367.               obtained (without the 'I' option) if SparkFS  isn't
  368.               loaded.
  369.  
  370.        -j     Store  just  the  name  of  a  saved file (junk the
  371.               path),  and  do  not  store  directory  names.   By
  372.               default,  zip will store the full path (relative to
  373.               the current path).
  374.  
  375.        -jj    [MacOS  only] record Fullpath (+ Volname). The com-
  376.               plete  path  including  volume  will  be stored. By
  377.               default the relative path will be stored.
  378.  
  379.        -J     Strip any prepended data (e.g. a SFX stub) from the
  380.               archive.
  381.  
  382.        -k     Attempt  to  convert the names and paths to conform
  383.               to MSDOS, store only the MSDOS attribute (just  the
  384.               user write attribute from UNIX), and mark the entry
  385.               as made under MSDOS (even though it was  not);  for
  386.               compatibility with PKUNZIP under MSDOS which cannot
  387.               handle certain names such as those with two dots.
  388.  
  389.        -l     Translate the Unix end-of-line  character  LF  into
  390.               the  MSDOS convention CR LF. This option should not
  391.  
  392.  
  393.  
  394. Info-ZIP              27 October 1998 (v2.3)                    6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ZIP(1L)                                                   ZIP(1L)
  401.  
  402.  
  403.               be used on binary files.  This option can  be  used
  404.               on  Unix  if  the  zip file is intended for PKUNZIP
  405.               under MSDOS. If the input files already contain  CR
  406.               LF,  this option adds an extra CR. This ensure that
  407.               unzip -a on Unix will get back an exact copy of the
  408.               original file, to undo the effect of zip -l.
  409.  
  410.        -ll    Translate the MSDOS end-of-line CR LF into Unix LF.
  411.               This option should not be  used  on  binary  files.
  412.               This option can be used on MSDOS if the zip file is
  413.               intended for unzip under Unix.
  414.  
  415.        -L     Display the zip license.
  416.  
  417.        -m     Move the specified  files  into  the  zip  archive;
  418.               actually, this deletes the target directories/files
  419.               after making the specified zip archive. If a direc-
  420.               tory  becomes empty after removal of the files, the
  421.               directory is also removed. No  deletions  are  done
  422.               until  zip  has  created the archive without error.
  423.               This is useful for conserving disk  space,  but  is
  424.               potentially  dangerous  so it is recommended to use
  425.               it in combination  with  -T  to  test  the  archive
  426.               before removing all input files.
  427.  
  428.        -n suffixes
  429.               Do  not  attempt  to  compress files named with the
  430.               given suffixes.  Such files are simply  stored  (0%
  431.               compression)  in  the  output zip file, so that zip
  432.               doesn't waste its time  trying  to  compress  them.
  433.               The  suffixes  are  separated  by  either colons or
  434.               semicolons.  For example:
  435.  
  436.                      zip -rn .Z:.zip:.tiff:.gif:.snd  foo foo
  437.  
  438.               will copy everything from  foo  into  foo.zip,  but
  439.               will  store  any files that end in .Z, .zip, .tiff,
  440.               .gif, or  .snd  without  trying  to  compress  them
  441.               (image  and  sound  files often have their own spe-
  442.               cialized compression  methods).   By  default,  zip
  443.               does not compress files with extensions in the list
  444.               .Z:.zip:.zoo:.arc:.lzh:.arj.  Such files are stored
  445.               directly  in  the  output archive.  The environment
  446.               variable ZIPOPT can be used to change  the  default
  447.               options. For example under Unix with csh:
  448.  
  449.                      setenv ZIPOPT "-n .gif:.zip"
  450.  
  451.               To attempt compression on all files, use:
  452.  
  453.                      zip -n : foo
  454.  
  455.               The  maximum  compression  option  -9 also attempts
  456.               compression on all files regardless of extension.
  457.  
  458.  
  459.  
  460. Info-ZIP              27 October 1998 (v2.3)                    7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. ZIP(1L)                                                   ZIP(1L)
  467.  
  468.  
  469.               On Acorn RISC OS systems the suffixes are  actually
  470.               filetypes  (3  hex  digit  format). By default, zip
  471.               does not compress files with filetypes in the  list
  472.               DDC:D96:68E  (i.e.  Archives, CFS files and PackDir
  473.               files).
  474.  
  475.        -N     Save Amiga filenotes as zipfile comments. They  can
  476.               be  restored  by using the -N option of unzip. This
  477.               option is available on the Amiga  only.  If  -c  is
  478.               used  also,  you are prompted for comments only for
  479.               those files that do not have filenotes.
  480.  
  481.        -o     Set the "last modified" time of the zip archive  to
  482.               the  latest  (oldest)  "last  modified"  time found
  483.               among the entries in the zip archive.  This can  be
  484.               used without any other operations, if desired.  For
  485.               example:
  486.  
  487.               zip -o foo
  488.  
  489.               will change the last modified time  of  foo.zip  to
  490.               the latest time of the entries in foo.zip.
  491.  
  492.  
  493.        -P password
  494.               use  password  to encrypt zipfile entries (if any).
  495.               THIS IS INSECURE!  Many multi-user  operating  sys-
  496.               tems  provide  ways for any user to see the current
  497.               command line of any other user; even on stand-alone
  498.               systems  there  is  always  the threat of over-the-
  499.               shoulder peeking.  Storing the  plaintext  password
  500.               as part of a command line in an automated script is
  501.               even worse.  Whenever possible, use  the  non-echo-
  502.               ing,  interactive  prompt to enter passwords.  (And
  503.               where  security  is  truly  important,  use  strong
  504.               encryption  such  as Pretty Good Privacy instead of
  505.               the relatively weak encryption provided by standard
  506.               zipfile utilities.)
  507.  
  508.        -q     Quiet  mode;  eliminate  informational messages and
  509.               comment prompts.  (Useful, for  example,  in  shell
  510.               scripts and background tasks).
  511.  
  512.        -r     Travel  the  directory  structure  recursively; for
  513.               example:
  514.  
  515.                      zip -r foo foo
  516.  
  517.               In this case, all the files and directories in  foo
  518.               are saved in a zip archive named foo.zip, including
  519.               files with  names  starting  with  ".",  since  the
  520.               recursion  does  not use the shell's file-name sub-
  521.               stitution mechanism.  If you wish to include only a
  522.               specific  subset  of the files in directory foo and
  523.  
  524.  
  525.  
  526. Info-ZIP              27 October 1998 (v2.3)                    8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. ZIP(1L)                                                   ZIP(1L)
  533.  
  534.  
  535.               its subdirectories, use the -i  option  to  specify
  536.               the  pattern  of  files to be included.  You should
  537.               not use -r with the name ".*", since  that  matches
  538.               ".."   which  will  attempt  to  zip  up the parent
  539.               directory (probably not what was intended).
  540.  
  541.        -R     Travel the directory structure recursively starting
  542.               at the current directory; for example:
  543.  
  544.                      zip -R foo *.c
  545.  
  546.               In  this  case,  all  the files matching *.c in the
  547.               tree starting at the current directory  are  stored
  548.               into  a  zip archive named foo.zip.  Note for PKZIP
  549.               users: the equivalent command is
  550.  
  551.                      pkzip -rP foo *.c
  552.  
  553.        -S     Include system and hidden  files.  This  option  is
  554.               effective  on  some  systems only; it is ignored on
  555.               Unix.  On MacOS, this option includes finder invis-
  556.               ible files, which are ignored otherwise.
  557.  
  558.        -t mmddyyyy
  559.               Do not operate on files modified prior to the spec-
  560.               ified date, where mm is the month (0-12), dd is the
  561.               day of the month (1-31), and yyyy is the year.  For
  562.               example:
  563.  
  564.                      zip -rt 12071991 infamy foo
  565.  
  566.               will add all the files in foo and  its  subdirecto-
  567.               ries that were last modified on or after 7 December
  568.               1991, to the zip archive infamy.zip.
  569.  
  570.        -tt mmddyyyy
  571.               Do not operate on files modified after  or  at  the
  572.               specified date, where mm is the month (0-12), dd is
  573.               the day of the month (1-31), and yyyy is the  year.
  574.               For example:
  575.  
  576.                      zip -rtt 11301995 infamy foo
  577.  
  578.               will  add  all the files in foo and its subdirecto-
  579.               ries that were last modified before the 30 November
  580.               1995, to the zip archive infamy.zip.
  581.  
  582.        -T     Test  the  integrity  of  the  new zip file. If the
  583.               check fails, the old  zip  file  is  unchanged  and
  584.               (with the -m option) no input files are removed.
  585.  
  586.        -u     Replace  (update)  an  existing  entry  in  the zip
  587.               archive only if it has been modified more  recently
  588.               than  the  version already in the zip archive.  For
  589.  
  590.  
  591.  
  592. Info-ZIP              27 October 1998 (v2.3)                    9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. ZIP(1L)                                                   ZIP(1L)
  599.  
  600.  
  601.               example:
  602.  
  603.                      zip -u stuff *
  604.  
  605.               will add any new files in  the  current  directory,
  606.               and update any files which have been modified since
  607.               the zip archive stuff.zip was last created/modified
  608.               (note  that zip will not try to pack stuff.zip into
  609.               itself when you do this).
  610.  
  611.               Note that the -u option with no arguments acts like
  612.               the -f (freshen) option.
  613.  
  614.        -v     Verbose mode or print diagnostic version info.
  615.  
  616.               Normally,  when  applied  to  real operations, this
  617.               option enables the display of a progress  indicator
  618.               during  compression and requests verbose diagnostic
  619.               info about zipfile structure oddities.
  620.  
  621.               When -v is the only command line argument, and std-
  622.               out  is  not  redirected  to  a  file, a diagnostic
  623.               screen is printed. In addition to the  help  screen
  624.               header  with  program  name,  version,  and release
  625.               date, some pointers to the Info-ZIP home  and  dis-
  626.               tribution  sites are given. Then, it shows informa-
  627.               tion about the target  environment  (compiler  type
  628.               and  version,  OS version, compilation date and the
  629.               enabled optional features used to  create  the  zip
  630.               executable.
  631.  
  632.        -V     Save  VMS file attributes. This option is available
  633.               on VMS only; zip archives created with this  option
  634.               will generally not be usable on other systems.
  635.  
  636.        -w     Append the version number of the files to the name,
  637.               including multiple versions of files.   (VMS  only;
  638.               default:  use  only  the  most  recent version of a
  639.               specified file).
  640.  
  641.        -x files
  642.               Explicitly exclude the specified files, as in:
  643.  
  644.                      zip -r foo foo -x \*.o
  645.  
  646.               which will include the contents of foo  in  foo.zip
  647.               while  excluding all the files that end in .o.  The
  648.               backslash avoids the shell  filename  substitution,
  649.               so  that  the  name matching is performed by zip at
  650.               all directory levels.
  651.  
  652.               Also possible:
  653.  
  654.                      zip -r foo foo -x@exclude.lst
  655.  
  656.  
  657.  
  658. Info-ZIP              27 October 1998 (v2.3)                   10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. ZIP(1L)                                                   ZIP(1L)
  665.  
  666.  
  667.               which will include the contents of foo  in  foo.zip
  668.               while  excluding  all the files that match the pat-
  669.               terns in the file exclude.lst.
  670.  
  671.        -X     Do  not  save  extra  file   attributes   (Extended
  672.               Attributes  on  OS/2,  uid/gid  and  file  times on
  673.               Unix).
  674.  
  675.        -y     Store symbolic links as such in  the  zip  archive,
  676.               instead   of   compressing  and  storing  the  file
  677.               referred to by the link (UNIX only).
  678.  
  679.        -z     Prompt for a multi-line comment for the entire  zip
  680.               archive.  The comment is ended by a line containing
  681.               just a period, or an end of file condition  (^D  on
  682.               UNIX, ^Z on MSDOS, OS/2, and VAX/VMS).  The comment
  683.               can be taken from a file:
  684.  
  685.                      zip -z foo < foowhat
  686.  
  687.        -#     Regulate the speed of compression using the  speci-
  688.               fied  digit  #,  where  -0 indicates no compression
  689.               (store all files), -1 indicates  the  fastest  com-
  690.               pression method (less compression) and -9 indicates
  691.               the slowest compression  method  (optimal  compres-
  692.               sion,  ignores  the  suffix list). The default com-
  693.               pression level is -6.
  694.  
  695.        -@     Take the list of input files from  standard  input.
  696.               Only one filename per line.
  697.  
  698.        -$     Include  the volume label for the the drive holding
  699.               the first file to be compressed.  If  you  want  to
  700.               include  only  the  volume label or to force a spe-
  701.               cific drive, use the drive name as first file name,
  702.               as in:
  703.  
  704.                      zip -$ foo a: c:bar
  705.  
  706.               This  option  is  effective  on  some  systems only
  707.               (MSDOS and OS/2); it is ignored on Unix.
  708.  
  709. EXAMPLES
  710.        The simplest example:
  711.  
  712.               zip stuff *
  713.  
  714.        creates the archive stuff.zip (assuming it does not exist)
  715.        and  puts all the files in the current directory in it, in
  716.        compressed form (the .zip suffix is  added  automatically,
  717.        unless  that  archive  name  given contains a dot already;
  718.        this allows the explicit specification of other suffixes).
  719.  
  720.        Because  of  the way the shell does filename substitution,
  721.  
  722.  
  723.  
  724. Info-ZIP              27 October 1998 (v2.3)                   11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. ZIP(1L)                                                   ZIP(1L)
  731.  
  732.  
  733.        files starting with "." are not included; to include these
  734.        as well:
  735.  
  736.               zip stuff .* *
  737.  
  738.        Even  this  will  not  include any subdirectories from the
  739.        current directory.
  740.  
  741.        To zip up an entire directory, the command:
  742.  
  743.               zip -r foo foo
  744.  
  745.        creates the archive foo.zip, containing all the files  and
  746.        directories  in the directory foo that is contained within
  747.        the current directory.
  748.  
  749.        You may want to make a zip archive that contains the files
  750.        in  foo,  without  recording the directory name, foo.  You
  751.        can use the -j option to leave off the paths, as in:
  752.  
  753.               zip -j foo foo/*
  754.  
  755.        If you are short on disk space, you might not have  enough
  756.        room  to  hold  both the original directory and the corre-
  757.        sponding compressed zip archive.  In this  case,  you  can
  758.        create  the  archive in steps using the -m option.  If foo
  759.        contains the subdirectories tom, dick, and harry, you can:
  760.  
  761.               zip -rm foo foo/tom
  762.               zip -rm foo foo/dick
  763.               zip -rm foo foo/harry
  764.  
  765.        where  the first command creates foo.zip, and the next two
  766.        add to it.  At the completion of  each  zip  command,  the
  767.        last  created archive is deleted, making room for the next
  768.        zip command to function.
  769.  
  770. PATTERN MATCHING
  771.        This section applies only to UNIX.  Watch this  space  for
  772.        details on MSDOS and VMS operation.
  773.  
  774.        The  UNIX  shells (sh(1) and csh(1)) do filename substitu-
  775.        tion on command arguments.  The special characters are:
  776.  
  777.        ?      match any single character
  778.  
  779.        *      match any number of characters (including none)
  780.  
  781.        []     match any character in the range  indicated  within
  782.               the brackets (example: [a-f], [0-9]).
  783.  
  784.        When  these  characters  are  encountered  (without  being
  785.        escaped with a backslash or quotes), the shell  will  look
  786.        for  files  relative  to  the  current path that match the
  787.  
  788.  
  789.  
  790. Info-ZIP              27 October 1998 (v2.3)                   12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. ZIP(1L)                                                   ZIP(1L)
  797.  
  798.  
  799.        pattern, and replace the argument with a list of the names
  800.        that matched.
  801.  
  802.        The zip program can do the same matching on names that are
  803.        in the zip archive being modified or, in the case  of  the
  804.        -x (exclude) or -i (include) options, on the list of files
  805.        to be operated on, by using backslashes or quotes to  tell
  806.        the  shell not to do the name expansion.  In general, when
  807.        zip encounters a name in the list of files to do, it first
  808.        looks for the name in the file system.  If it finds it, it
  809.        then adds it to the list of files to do.  If it  does  not
  810.        find  it,  it  looks for the name in the zip archive being
  811.        modified (if it exists), using the pattern matching  char-
  812.        acters  described  above,  if present.  For each match, it
  813.        will add that name to the list of files to  be  processed,
  814.        unless  this name matches one given with the -x option, or
  815.        does not match any name given with the -i option.
  816.  
  817.        The pattern matching includes the path,  and  so  patterns
  818.        like \*.o match names that end in ".o", no matter what the
  819.        path prefix is.  Note  that  the  backslash  must  precede
  820.        every  special  character (i.e. ?*[]), or the entire argu-
  821.        ment must be enclosed in double quotes ("").
  822.  
  823.        In general, use backslash  to  make  zip  do  the  pattern
  824.        matching  with  the  -f (freshen) and -d (delete) options,
  825.        and sometimes after the -x (exclude) option when used with
  826.        an appropriate operation (add, -u, -f, or -d).
  827.  
  828. SEE ALSO
  829.        compress(1), shar(1L), tar(1), unzip(1L), gzip(1L)
  830.  
  831. DIAGNOSTICS
  832.        The  exit  status  (or  error level) approximates the exit
  833.        codes defined by PKWARE and takes on the following values,
  834.        except under VMS:
  835.  
  836.               0      normal; no errors or warnings detected.
  837.  
  838.               2      unexpected end of zip file.
  839.  
  840.               3      a  generic  error  in the zipfile format was
  841.                      detected.   Processing  may  have  completed
  842.                      successfully  anyway;  some  broken zipfiles
  843.                      created by other archivers have simple work-
  844.                      arounds.
  845.  
  846.               4      zip was unable to allocate memory for one or
  847.                      more buffers during program  initialization.
  848.  
  849.               5      a  severe  error  in  the zipfile format was
  850.                      detected.  Processing probably failed  imme-
  851.                      diately.
  852.  
  853.  
  854.  
  855.  
  856. Info-ZIP              27 October 1998 (v2.3)                   13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. ZIP(1L)                                                   ZIP(1L)
  863.  
  864.  
  865.               6      entry too large to be split with zipsplit
  866.  
  867.               7      invalid comment format
  868.  
  869.               8      zip -T failed or out of memory
  870.  
  871.               9      the  user  aborted zip prematurely with con-
  872.                      trol-C (or similar)
  873.  
  874.               10     zip encountered an error while using a  temp
  875.                      file
  876.  
  877.               11     read or seek error
  878.  
  879.               12     zip has nothing to do
  880.  
  881.               13     missing or empty zip file
  882.  
  883.               14     error writing to a file
  884.  
  885.               15     zip was unable to create a file to write to
  886.  
  887.               16     bad command line parameters
  888.  
  889.               18     zip could not open a specified file to read
  890.  
  891.        VMS  interprets  standard  Unix  (or  PC) return values as
  892.        other, scarier-looking things, so zip  instead  maps  them
  893.        into  VMS-style  status  codes.  The current mapping is as
  894.        follows:   1 (success) for normal exit,
  895.         and  (0x7fff000?  +  16*normal_zip_exit_status)  for  all
  896.        errors,  where  the `?' is 0 (warning) for zip value 12, 2
  897.        (error) for the zip values 3, 6, 7, 9, 13, 16, 18,  and  4
  898.        (fatal error) for the remaining ones.
  899.  
  900. BUGS
  901.        zip  2.2  is not compatible with PKUNZIP 1.10. Use zip 1.1
  902.        to produce zip files which can  be  extracted  by  PKUNZIP
  903.        1.10.
  904.  
  905.        zip  files  produced by zip 2.2 must not be updated by zip
  906.        1.1 or PKZIP 1.10, if they contain encrypted members or if
  907.        they  have  been  produced  in a pipe or on a non-seekable
  908.        device. The old versions of zip or PKZIP would  create  an
  909.        archive  with  an  incorrect format.  The old versions can
  910.        list the contents of the zip file but  cannot  extract  it
  911.        anyway (because of the new compression algorithm).  If you
  912.        do not use encryption and use regular disk files,  you  do
  913.        not have to care about this problem.
  914.  
  915.        Under  VMS,  not  all  of the odd file formats are treated
  916.        properly.  Only stream-LF format zip files are expected to
  917.        work  with  zip.   Others  can  be  converted  using Rahul
  918.        Dhesi's BILF program.  This version of zip handles some of
  919.  
  920.  
  921.  
  922. Info-ZIP              27 October 1998 (v2.3)                   14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. ZIP(1L)                                                   ZIP(1L)
  929.  
  930.  
  931.        the  conversion internally.  When using Kermit to transfer
  932.        zip files from Vax to MSDOS, type "set file type block" on
  933.        the  Vax.   When  transfering from MSDOS to Vax, type "set
  934.        file type fixed" on the Vax.  In  both  cases,  type  "set
  935.        file type binary" on MSDOS.
  936.  
  937.        Under VMS, zip hangs for file specification that uses DEC-
  938.        net syntax foo::*.*.
  939.  
  940.        On OS/2, zip  cannot  match  some  names,  such  as  those
  941.        including  an  exclamation mark or a hash sign.  This is a
  942.        bug in OS/2 itself:  the  32-bit  DosFindFirst/Next  don't
  943.        find  such names.  Other programs such as GNU tar are also
  944.        affected by this bug.
  945.  
  946.        Under OS/2, the amount of Extended Attributes displayed by
  947.        DIR  is  (for  compatibility)  the  amount returned by the
  948.        16-bit version of DosQueryPathInfo(). Otherwise  OS/2  1.3
  949.        and  2.0  would  report  different  EA sizes when DIRing a
  950.        file.  However,  the  structure  layout  returned  by  the
  951.        32-bit  DosQueryPathInfo()  is  a  bit  different, it uses
  952.        extra padding bytes and link pointers (it's a linked list)
  953.        to have all fields on 4-byte boundaries for portability to
  954.        future RISC OS/2 versions. Therefore the value reported by
  955.        zip  (which  uses this 32-bit-mode size) differs from that
  956.        reported by DIR.  zip stores the 32-bit format for  porta-
  957.        bility,  even  the 16-bit MS-C-compiled version running on
  958.        OS/2 1.3, so even this one shows the 32-bit-mode size.
  959.  
  960. AUTHORS
  961.        Copyright (C) 1990-1997  Mark  Adler,  Richard  B.  Wales,
  962.        Jean-loup  Gailly,  Onno  van  der Linden, Kai Uwe Rommel,
  963.        Igor Mandrichenko, John Bush and Paul Kienitz.  Permission
  964.        is  granted to any individual or institution to use, copy,
  965.        or redistribute this software so long as all of the origi-
  966.        nal  files  are  included, that it is not sold for profit,
  967.        and that this copyright notice is retained.
  968.  
  969.        LIKE ANYTHING ELSE THAT'S FREE,  ZIP  AND  ITS  ASSOCIATED
  970.        UTILITIES  ARE PROVIDED AS IS AND COME WITH NO WARRANTY OF
  971.        ANY KIND, EITHER EXPRESSED OR IMPLIED. IN  NO  EVENT  WILL
  972.        THE  COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES RESULTING
  973.        FROM THE USE OF THIS SOFTWARE.
  974.  
  975.        Please  send  bug  reports  and  comments  by  email   to:
  976.        zip-bugs@lists.wku.edu.   For  bug reports, please include
  977.        the version of zip (see zip-h ), the make options used  to
  978.        compile  it  see zip-v ), the machine and operating system
  979.        in use, and as much additional information as possible.
  980.  
  981. ACKNOWLEDGEMENTS
  982.        Thanks to R. P. Byrne for his  Shrink.Pas  program,  which
  983.        inspired this project, and from which the shrink algorithm
  984.        was stolen; to Phil Katz for placing in the public  domain
  985.  
  986.  
  987.  
  988. Info-ZIP              27 October 1998 (v2.3)                   15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. ZIP(1L)                                                   ZIP(1L)
  995.  
  996.  
  997.        the zip file format, compression format, and .ZIP filename
  998.        extension, and for accepting minor  changes  to  the  file
  999.        format;  to  Steve  Burg for clarifications on the deflate
  1000.        format; to Haruhiko Okumura and Leonid Broukhis  for  pro-
  1001.        viding some useful ideas for the compression algorithm; to
  1002.        Keith Petersen, Rich Wales, Hunter Goatley and Mark  Adler
  1003.        for providing a mailing list and ftp site for the Info-ZIP
  1004.        group to use; and most importantly, to the Info-ZIP  group
  1005.        itself  (listed  in  the  file  infozip.who) without whose
  1006.        tireless testing and bug-fixing  efforts  a  portable  zip
  1007.        would  not  have  been  possible.  Finally we should thank
  1008.        (blame) the first Info-ZIP  moderator,  David  Kirschbaum,
  1009.        for  getting  us  into  this mess in the first place.  The
  1010.        manual page was rewritten for UNIX by R. P. C. Rodgers.
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054. Info-ZIP              27 October 1998 (v2.3)                   16
  1055.  
  1056.  
  1057.